<?php

namespace App\Http\Requests\Admin\AdminCategory;

use App\Http\Requests\Request;

class CategoryRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
            'cat_name' => 'required',
            //'tariff_percent' => 'required|numeric'
            'excise_duty_percent' => 'required|numeric',
            'value_added_tax_percent' => 'required|numeric',
            'cat_picture' => 'required'
            ];
    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'cat_name.required' => '请填写分类名称',
            //'tariff_percent.required' => '请填写关税',
            'excise_duty_percent.required' => '请填写消费税',
          'value_added_tax_percent.required' => '请填写增值税',
           // 'tariff_percent.numeric' => '关税必须为数字'
            'excise_duty_percent.numeric' => '消费税必须为数字',
            'value_added_tax_percent.numeric' => '增值税税必须为数字',
            'cat_picture.required' => '请上传分类展示图'
        ];
    }
}
